<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new AppBundle\AppBundle(),
            //图片上传模块
            new Assets\UploadBundle\AssetsUploadBundle(),
            //后台框架模块
            new System\AdminBundle\SystemAdminBundle(),
            //前台网站
            new Web\MainSiteBundle\WebMainSiteBundle(),

            //通用模块-用户
            new Model\RoleBundle\ModelRoleBundle(),
            new Model\UserBundle\ModelUserBundle(),
            new Model\UserGroupsBundle\ModelUserGroupsBundle(),
            new Model\UserGroupsRoleBundle\ModelUserGroupsRoleBundle(),

            //通用模块-学校
            new Model\SchoolBundle\ModelSchoolBundle(),
            new Model\SchoolCategoryBundle\ModelSchoolCategoryBundle(),

            //通用模块-教师
            new Model\TeacherBundle\ModelTeacherBundle(),
            new Model\TeacherCategoryBundle\ModelTeacherCategoryBundle(),

            //通用模块-课程
            new Model\CourseBundle\ModelCourseBundle(),
            new Model\CourseCategoryBundle\ModelCourseCategoryBundle(),
            new Model\CourseLikesBundle\ModelCourseLikesBundle(),
            new Model\CourseCollectBundle\ModelCourseCollectBundle(),

            //通用模块-评论
            new Model\CommentsBundle\ModelCommentsBundle(),
            new Model\CommentsReplyBundle\ModelCommentsReplyBundle(),

            //通用模块-笔记
            new Model\NoteBundle\ModelNoteBundle(),
            new Model\NoteReplyBundle\ModelNoteReplyBundle(),

            //通用模块-资讯
            new Model\NewsBundle\ModelNewsBundle(),
            new Model\NewsCategoryBundle\ModelNewsCategoryBundle(),

            //通用模块-消息
            new Model\MessageBundle\ModelMessageBundle(),
            new Model\MessageCategoryBundle\ModelMessageCategoryBundle(),
            new Web\MainAppBundle\WebMainAppBundle(),

            //通用模块-题库-题目
            new Model\QuestionBundle\ModelQuestionBundle(),

            //考试练习模块
            new Model\ExamBundle\ModelExamBundle(),

            //考试记录
            new Model\LogExamBundle\ModelLogExamBundle(),
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
        }

        return $bundles;
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
    }
}
